#include "stream/impl/rocksdb/Table.h"

#include "rocksdb/db.h"

namespace stream {
namespace impl {
namespace rocksdb {

Table::Table(std::shared_ptr<::rocksdb::DB> db, const std::string & name, ::rocksdb::ColumnFamilyHandle * handle)
:_db(db)
, _name(name)
, _handle(handle)
{
}
Table::~Table(){
}

::rocksdb::Status Table::get(const std::string & key, std::string & value) {
	return _db->Get(::rocksdb::ReadOptions(), _handle, key, &value);
}
::rocksdb::Status Table::put(const std::string & key, const std::string & value){
	return _db->Put(::rocksdb::WriteOptions(), _handle, key, value);
}
::rocksdb::Status Table::del(const std::string & key){
	return _db->Delete(::rocksdb::WriteOptions(), _handle, key);
}

}//end namespace rocksdb
}//end namespace impl
}//end namespace stream
